<?php

require_once "tfsbox_phpbb3.class.php";
TFsBOX::enableDebugging();

define('TFsBOX_INDEX', true);
define('IN_PHPBB', true);

$tfsbox = new TFsBOX_PHPBB3;

$user = null;
$phpbb_root_path = PHPBB3_ROOT_PATH;
$phpEx = substr(strrchr(__FILE__, '.'), 1);

require_once $phpbb_root_path . 'common.' . $phpEx;

$user->session_begin();
$auth->acl($user->data);
$user->setup();

TFsBOX::$Session->setAuthReference($auth);
TFsBOX::$Session->setUserReference($user);
TFsBOX::$Session->startSession(); // restart session

$tfsbox->parsePathInfo(); // must come after startSession()

if (!defined("TFsBOX_SHOUTS_ONLY")):

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script type="text/javascript" src="<?php echo TFsBOXSession::urlRoot(); ?>/js/jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="<?php echo TFsBOXSession::urlRoot(); ?>/js/jquery-ui-1.8.custom.min.js"></script>
<script type="text/javascript" src="<?php echo TFsBOXSession::urlRoot(); ?>/js/jquery.tools.min.js"></script>
<script type="text/javascript" src="<?php echo TFsBOXSession::urlRoot(); ?>/tfsbox.js"></script>
<script type="text/javascript">
var TFSBOX_SCRIPT_PATH = '<?php echo $_SERVER['SCRIPT_NAME'].'/tfsbox/shouts'; ?>';
var TFSBOX_TIME_OUT = <?php echo TFsBOX::$Config->value('antispam_timeout', 5); ?>000;
<?php if (TFsBOX::$Config->value('auto_refresh', 'yes') == 'yes'): ?>
var TFSBOX_INTERVAL = setInterval(
	function ()
	{
		refresh_shouts(TFSBOX_SCRIPT_PATH);
	},
	TFSBOX_TIME_OUT
);
<?php endif; ?>
</script>
<title><?php echo TFsBOX::Name ." (v". TFsBOX::Version .")"; ?></title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<link rel="stylesheet" type="text/css" href="<?php echo TFsBOXSession::urlRoot(); ?>/exts/phpbb3/<?php echo strtolower(TFsBOX::$Session->userStyleName()); ?>.css" />
</head>
<body>
<?php

$tfsbox->renderShoutBox();

?>
<div id="screen"></div>
</body>
</html>
<?php

else:
	TFsBOX::$View->renderShouts(false, false);
endif;

?>
